package com.preparation.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.preparation.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    //根据用户名查询
    @Select("select * from tbl_user where username=#{username}")
    User getByUsername(String username);

    //修改用户头像
    @Update("update tbl_user set avatar=#{avatar} where id=#{id}")
    int updateAvatar(int id, String avatar);

}
